<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
<title>Insert title here</title>
</head>
<style>
#title {
	position: relative;
	text-align: center;
	top: 20px;
}

#content {
	width: 223px;
	height: 100px;
	margin: auto;
}

#button {
	left: 103px;
	position: relative;
	font-size: 15px;
}

span {
	color: red;
	left: 73px;
	top: 5px;
	position: relative;
}

#judge {
	display: none;
}
</style>
<script>
	$(function() {
		$("#button").click(function() {
			$.ajax({
				url : 'judge/loginjudge',
				type : 'post',
				dataType : 'json',
				data : {
					'username' : $('#username').val(),
					"password" : $("#password").val(),
				},
				success : function(data) {
					console.log(data);
					if (data == true) {
						$("#submit").submit();
					} else {
						$('#judge').css('display', 'block')
					}
				}
			})
		})

	})
</script>
<body>
	<h1 id='title'>email</h1>
	<div id='content'>
		<form action='first/loginsuccess' id='submit' method='post'>
			账号：<input name='username' id='username'><br />
			<br /> 密码：<input name='password' id='password'><br />
			<br /> <input id='button' type='button' value='登录'>
		</form>
		<div id='judge'>
			<span>账号密码错误</span>
		</div>
	</div>
</body>
</html>